import { RouteRecordRaw } from "vue-router";
import abcb from "@/views/AbcB.vue";
import abca from "@/views/AbcA.vue";
import admin from "@/views/AdminView.vue";
import noAuth from "@/views/NoAuth.vue";
import ACCESS_ENUM from "@/access/accessEnum";
import UserLayout from "@/layouts/UserLayout.vue";
import userLoginView from "@/views/user/UserLoginView.vue";
import userRegisterView from "@/views/user/UserRegisterView.vue";

export const routes: Array<RouteRecordRaw> = [
  {
    path: "/user",
    name: "用户",
    component: UserLayout,
    children: [
      {
        path: "/user/login",
        name: "用户登录",
        component: userLoginView,
      },
      {
        path: "/user/register",
        name: "用户注册",
        component: userRegisterView,
      },
    ],
    meta: {
      hidden: true,
    },
  },
  {
    path: "/",
    name: "主页",
    component: abca,
    meta: {
      assess: ACCESS_ENUM.NOT_LOGIN,
    },
  },
  {
    path: "/b",
    name: "关于我的",
    component: abcb,
    meta: {
      assess: ACCESS_ENUM.NOT_LOGIN,
    },
  },
  {
    path: "/admin",
    name: "管理员",
    component: admin,
    meta: {
      assess: ACCESS_ENUM.ADMIN,
    },
  },
  {
    path: "/noAuth",
    name: "无权限",
    component: noAuth,
    meta: { hidden: true }, // 标识此路由为隐藏路由
  },
];
